<template>
  <view class="test">111</view>
  <slot :obj="obj" name="name"></slot>
  <view v-if="isShow">卧槽</view>
  <input type="text" v-model="a" confirm-type="search">
</template>

<script setup>
  import {
    onMounted,
    ref,
    useAttrs,
    useSlots,
    watch
  } from "vue";

  let a = ref('')

  let obj = ref({
    a: 1,
    b: 'wcccc'
  })

  let isShow = ref(false)

  watch([a, obj], (n, o) => {
    console.log(n, o)
    // console.log(nA, oA, nObj, oObj)
  })

  onMounted(() => {
    let attrs = useAttrs()
    let slots = useSlots()
    console.log(attrs)
    console.log(slots)
    if (slots.name) {
      isShow.value = true
    } else {
      isShow.value = false
    }
  })
</script>

<style lang="scss">
</style>
